#include <time.h>

bool fpsToggle = false;
double currentTime = 0;
double previousTime = 0;
double frameCount = 0;

// Function that shows FPS in commandline if enabled
void FPS(){
	if(!fpsToggle) return;
  frameCount++;
  currentTime = glutGet(GLUT_ELAPSED_TIME);
  int timeInterval = currentTime - previousTime;
  if(timeInterval > 1000){
      std::cout <<  "FPS: " << (frameCount / (timeInterval / 1000.0f)) << ".\n";
      previousTime = currentTime;
      frameCount = 0;
  }
}
